﻿using sMES_Base.service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using sMES_Base;
using exe_machine_check_process.Modules;
using exe_machine_check_process;


namespace exe_machine_check_process_C
{
    /// <summary>
	/// 服務[exe_machine_check_process]
    /// <auth>gracecai</auth><time>2018/12/4 下午 03:40:57</time>
    /// <description></description>
    /// <list>
    ///     <modify>
    ///         <auth></auth><mantis></mantis><time></time>
    ///         <description></description>
    ///     </modify>
    /// </list>
    /// </summary>
    public class exe_machine_check_process_C : BaseService
    {
        public exe_machine_check_process_C(ServiceInfo _ServiceInfo) : base(_ServiceInfo)
        {
        }

        public override ServiceResponse ExecuteImplement(ServiceRequest ServiceRequest, ServiceResponse ServiceResponse)
        {
            //將dynamic 物件轉換成實體物件
            RequestContent content = ServiceRequest.GetContent<RequestContent>();

            //取出Utilitiy
            exe_machine_check_process_utility utility = GetUtilities<exe_machine_check_process_utility>();

            ServiceResponse.Content = new ResponseContent();
            //20210609 Modify by德義家興for#91011: [标准][DEV][行业议题]机加工-CNC-批量设备点检
            //20220907 Modify by yuting for#118547: 生產線作業平台設備點發生錯誤
            if (content.selected_EquipmentList !=null && content.selected_EquipmentList.Count >= 2)  //是否多選
            {
                utility.multi_equipment_dispatch_area_info_set(content);
            }else{
                utility.dispatch_area_info_set(content);
            }

            return ServiceResponse;
        }
    }
}
